<tr class="prop">
  <td valign="top" class="name">
    <label for="type">Type:</label>
  </td>
  <td valign="top" class="value ${hasErrors(bean:company,field:'type','errors')}">
    <g:select optionKey="id" from="${CompanyType.list(sort:'name')}" noSelection="${['null':'']}" name="type.id" value="${company?.type?.id}" ></g:select>
  </td>
</tr>
<tr class="prop">
  <td valign="top" class="name">
    <label for="name">Company Name:</label>
  </td>
  <td valign="top" class="value ${hasErrors(bean:company,field:'name','errors')}">
    <input type="text" id="name" name="name" value="${fieldValue(bean:company,field:'name')}"/>
  </td>
</tr>
<tr class="prop">
  <td valign="top" class="name">
    <label for="doctorsName">Doctors Name:</label>
  </td>
  <td valign="top" class="value ${hasErrors(bean:company,field:'doctorsName','errors')}">
    <input type="text" id="doctorsName" name="doctorsName" value="${fieldValue(bean:company,field:'doctorsName')}"/>
  </td>
</tr>
<tr class="prop">
  <td valign="top" class="name">Primary Address:</td>
  <td valign="top" class="value"><g:link controller="address" action="show" params="[companyId:company.id, addressType:'Primary', id:company.primaryAddress.id]">${company?.primaryAddress?.encodeAsHTML()}</g:link></td>
</tr>
<tr class="prop">
  <td valign="top" class="name">Billing Address:</td>
  <td valign="top" class="value">
    <g:if test="${company.billingAddress}">
      <g:link controller="address" action="show" params="[companyId:company.id, addressType:'Billing', id:company.billingAddress.id]">${company?.billingAddress?.encodeAsHTML()}</g:link>
    </g:if>
    <g:else>
      <g:link controller="address" action="create" params="['companyId':company.id]">Create Billing Address</g:link>
    </g:else>
  </td>
</tr>
<tr class="prop">
  <td valign="top" class="name">
    <label for="phone">Phone:</label>
  </td>
  <td valign="top" class="value ${hasErrors(bean:company,field:'phone','errors')}">
    <input type="text" id="phone" name="phone" value="${fieldValue(bean:company,field:'phone')}"/>
  </td>
</tr>
<tr class="prop">
  <td valign="top" class="name">
    <label for="fax">Fax:</label>
  </td>
  <td valign="top" class="value ${hasErrors(bean:company,field:'fax','errors')}">
    <input type="text" id="fax" name="fax" value="${fieldValue(bean:company,field:'fax')}"/>
  </td>
</tr>
<tr class="prop">
  <td valign="top" class="name">
    <label for="phone">Website:</label>
  </td>
  <td valign="top" class="value ${hasErrors(bean:company,field:'website','errors')}">
    <input type="text" id="website" name="website" value="${fieldValue(bean:company,field:'website')}"/>
  </td>
</tr>
<tr class="prop">
  <td valign="top" class="name">
    <label for="email">Email:</label>
  </td>
  <td valign="top" class="value ${hasErrors(bean:company,field:'email','errors')}">
    <input type="text" id="email" name="email" value="${fieldValue(bean:company,field:'email')}"/>
  </td>
</tr>
<tr class="prop">
  <td valign="top" class="name">
    <label for="active">Active:</label>
  </td>
  <td valign="top" class="value ${hasErrors(bean:company,field:'active','errors')}">
    <g:checkBox name="admin" value="${company?.active}" ></g:checkBox>
  </td>
</tr>
<g:ifAnyGranted role="ROLE_ADMIN,ROLE_POWER_USER">
  <tr class="prop">
    <td valign="top" class="name">
      <label for="outOfOffice">Principle Company:</label>
    </td>
    <td valign="top" class="value ${hasErrors(bean:company, field:'principle','errors')}">
      <g:checkBox name="principle" value="${company?.principle}" ></g:checkBox>
    </td>
  </tr>
</g:ifAnyGranted>
%{--          <tr class="prop">
  <td valign="top" class="name">
    <label for="parentCompany">Parent Company:</label>
  </td>
  <td valign="top" class="value ${hasErrors(bean:company,field:'parentCompany','errors')}">
    <gui:autoComplete
      id="companies"
      controller="company"
      action="listCompaniesForACAsJSON"
      queryDelay="0.5"
      /><br />
  </td>
</tr>--}%
<tr class="prop">
  <td valign="top" class="name">
    <label for="notes">Notes:</label>
  </td>
  <td valign="top" class="value ${hasErrors(bean:company,field:'notes','errors')}">
    <textarea rows="3" cols="25" name="notes">${fieldValue(bean:company, field:'notes')}</textarea>
  </td>
</tr>
